import java.awt.Graphics;
import java.awt.Rectangle;


public abstract class GameObject {
	protected int xPos;
	protected int yPos;
	protected int width;
	protected int height;
	protected int vx, vy;
	protected Rectangle rect;
	
	public GameObject(int xPos, int yPos,
			int width, int height, int vx, int vy) {
		this.xPos = xPos;
		this.yPos = yPos;
		this.width = width;
		this.height = height;
		this.vx = vx;
		this.vy = vy;
		this.rect = new Rectangle(xPos, yPos, width, height);
	}
	
	abstract public void update(Main screen);
	
	abstract public void render(Graphics g, Main screen);
	
	public int getxPos() {
		return xPos;
	}
	public void setxPos(int xPos) {
		this.xPos = xPos;
	}
	public int getyPos() {
		return yPos;
	}
	public void setyPos(int yPos) {
		this.yPos = yPos;
	}
	public int getWidth() {
		return width;
	}
	public void setWidth(int width) {
		this.width = width;
		if(xPos > (width/2)) {
			xPos = 350 - this.width/2;
		}
		else {
			xPos = 2;
		}
		this.rect = new Rectangle(xPos, yPos, width, height);
	}
	public int getHeight() {
		return height;
	}
	public void setHeight(int height) {
		this.height = height;
	}

	public Rectangle getRect() {
		return rect;
	}

	public void setRect(Rectangle rect) {
		this.rect = rect;
	}

	public int getVx() {
		return vx;
	}

	public void setVx(int vx) {
		this.vx = vx;
	}

	public int getVy() {
		return vy;
	}

	public void setVy(int vy) {
		this.vy = vy;
	}

}
